package cn.thread;
//公共接口
public interface Proxy {
void proxyMade();
}
//真实角色
class Student implements Proxy{

    @Override
    public void proxyMade() {
        System.out.println("我要去玩游戏！");
    }
}
//代理角色
class StudentProxy implements Proxy{
    Proxy student;
    public StudentProxy(Proxy student){
        this.student=student;
    }
    @Override
    public void proxyMade() {
        ready();
        this.student.proxyMade();
        after();
    }
    public void ready(){
        System.out.println("完成作业！");
    }
    public void after(){
        System.out.println("作业优秀！");
    }
}
class StudentProxyTest{
    public static void main(String args[]){
        new StudentProxy(new Student()).proxyMade();
    }
}
